package edu.se.jai.websocketgateway.service;

import edu.se.jai.dubboapi.proto.GameServiceProto.*;
import edu.se.jai.dubboapi.service.HealthCheckApi;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * 健康检查服务实现类
 * 
 * 实现 HealthCheckApi 接口，使用 Triple 协议和 Protobuf 序列化
 * 主要目的：让 websocket-gateway 作为 Dubbo 服务提供者注册到 Nacos
 */
@Slf4j
@Service
@DubboService(interfaceClass = HealthCheckApi.class, protocol = "tri")
public class HealthCheckServiceImpl implements HealthCheckApi {

    @Override
    public Result healthCheck() {
        log.debug("收到健康检查请求");
        
        return Result.newBuilder()
                .setSuccess(true)
                .setStringData("websocket-gateway is healthy")
                .build();
    }
}

